USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0004_CARGA]    Script Date: 11/25/2011 11:53:46 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WASP_M0004_CARGA]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WASP_M0004_CARGA]
GO

USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0004_CARGA]    Script Date: 11/25/2011 11:53:46 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[WASP_M0004_CARGA] 

AS
BEGIN
select 
	a.aosuc as SUC, 
    a.CRCREDITO,
	a.RUTTRABAJA,
	a.FNACITRABA,
	a.SEXOTRABAJ,
	a.CRMONTO,
	b.CUOTAS as CRCUOTAS,
	a.CRTASA  ,
	a.CRCLASE,
	a.CRFECAPROB,
	a.TIPO_TRABAJADOR

into dbo.as_credi_vigente_temp
from 
	dbo.as_creditos_vigentes_temp a ,
    DBO.CUOTAS_AUX b
where
	 a.aosuc = b.aosuc and
	 a.aocta = b.aocta and
 	 a.CRCREDITO = b.aooper 
END

GO


